package com.fy.core.exception;

import com.fy.core.enums.ApiErrorEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ServiceException extends RuntimeException{
    private Integer code;

    private String msg;

    public ServiceException(ApiErrorEnum errorEnum) {

        this.code = errorEnum.getCode();
        this.msg = errorEnum.getMsg();
    }
}
